﻿namespace EquipmentAlarmSystem.Service.Models;

/// <summary>
/// ModbusTcp 设备连接信息
/// </summary>
public class DeviceInformationModusTcp : DeviceInformation
{
    /// <summary>
    /// 设备地址
    /// </summary>
    public string Ip { get; set; }

    /// <summary>
    /// 端口
    /// </summary>
    public short Port { get; set; } = 502;

    /// <summary>
    ///功能码 
    /// </summary>
    public FunctionBlock FunctionCode { get; set; }

    /// <summary>
    /// 设备号
    /// </summary>
    public byte SlaveAddress { get; set; }

    /// <summary>
    /// 开始地址
    /// </summary>
    public ushort StartAddress { get; set; }

    /// <summary>
    /// 长度
    /// </summary>
    public ushort NumberOfPoints { get; set; }

    /// <summary>
    /// 数据点位信息
    /// </summary>
    public List<PointInformation> PointInformation { get; set; }
}

/// <summary>
/// 功能块
/// </summary>
public enum FunctionBlock
{
    Coils, Inputs
}